using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Neeko.XNA.UI
{
    public delegate void UIElementMouseEvent(UIElement sender, MouseState mouseState);
    public delegate void UIElementKeyboardEvent(UIElement sender);

    public abstract class UIElement
    {
        public Vector2 Position { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }

        public Texture2D Texture { get; set; }
        public Rectangle SourceRectangle { get; set; }

        public bool Enabled { get; set; }
        public bool Visible { get; set; }

        public virtual void Update(GameTime gameTime, MouseState mouseState)
        {
            
        }

        public virtual void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            if (this.Visible && this.Texture != null)
            {
                spriteBatch.Draw(this.Texture, new Rectangle((int)this.Position.X, (int)this.Position.Y, this.Width, this.Height), Color.White);
            }
        }
    }
}
